Magnetic sensor assembly for actuating a wellbore valve

ABSTRACT

A sensor assembly for actuating a valve comprising: a magnet; and a sensor for the magnet, wherein a tool that is positioned adjacent to the magnet alters the magnetic field of the magnet, wherein the sensor detects the alteration of the magnetic field, and when the sensor detects the alteration, then the sensor actuates a valve to open or close. A method of actuating a valve in a wellbore comprising: positioning the sensor assembly within the wellbore; and running the tool into the wellbore. A system for actuating a valve, the system comprising: a wellbore; the valve; a tool positioned within the casing; and the sensor assembly, wherein the sensor assembly detects the presence or absence of the tool at the location of the magnet, and wherein the sensor assembly actuates the valve to open or close based on the location of the tool.

TECHNICAL FIELD

A valve can be used to close off or allow fluid flow through a casing of a wellbore. The valve can be actuated to open or close. The valve can be actuated via a magnetic sensor assembly that can detect the presence or absence of a downhole tool.

BRIEF DESCRIPTION OF THE FIGURES

The features and advantages of certain embodiments will be more readily appreciated when considered in conjunction with the accompanying figures. The figures are not to be construed as limiting any of the preferred embodiments.

FIG. 1 is cross-sectional view of a well system showing a tool located above a magnetic sensor assembly and a valve in a closed position.

FIG. 1A is an enlarged cross-sectional view of the valve and sensor assembly.

FIG. 2 is cross-sectional view of the well system showing the tool located adjacent to the sensor assembly and the valve in a closed position.

FIG. 2A is an enlarged cross-sectional view of the valve and sensor assembly.

FIG. 3 is cross-sectional view of the well system showing the tool located below the sensor assembly and the valve in an open position.

FIGS. 4A-4E are cross-sectional views of the well system showing how a sequence of moving the tool above and adjacent to the sensor assemblies can be used to open the valve.

DETAILED DESCRIPTION

Oil and gas hydrocarbons are naturally occurring in some subterranean formations. In the oil and gas industry, a subterranean formation containing oil and/or gas is referred to as a reservoir. A reservoir can be located under land or off shore. Reservoirs are typically located in the range of a few hundred feet (shallow reservoirs) to a few tens of thousands of feet (ultra-deep reservoirs). In order to produce oil or gas, a wellbore is drilled into a reservoir or adjacent to a reservoir. The oil, gas, or water produced from a reservoir is called a reservoir fluid.

As used herein, a “fluid” is a substance having a continuous phase that tends to flow and to conform to the outline of its container when the substance is tested at a temperature of 71° F. (22° C.) and a pressure of one atmosphere “atm” (0.1 megapascals “MPa”). A fluid can be a liquid or gas.

A well can include, without limitation, an oil, gas, or water production well, or an injection well. As used herein, a “well” includes at least one wellbore. A wellbore can include vertical, inclined, and horizontal portions, and it can be straight, curved, or branched. As used herein, the term “wellbore” includes any cased, and any uncased, open-hole portion of the wellbore. A near-wellbore region is the subterranean material and rock of the subterranean formation surrounding the wellbore. As used herein, a “well” also includes the near-wellbore region. The near-wellbore region is generally considered to be the region within approximately 100 feet radially of the wellbore. As used herein, “into a well” means and includes into any portion of the well, including into the wellbore or into the near-wellbore region via the wellbore.

A portion of a wellbore can be an open hole or cased hole. In an open-hole wellbore portion, a tubing string can be placed into the wellbore. The tubing string allows fluids to be introduced into or flowed from a remote portion of the wellbore. In a cased-hole wellbore portion, a casing is placed into the wellbore that can also contain a tubing string. A wellbore can contain an annulus. Examples of an annulus include, but are not limited to: the space between the wellbore and the outside of a tubing string in an open-hole wellbore; the space between the wellbore and the outside of a casing in a cased-hole wellbore; and the space between the inside of a casing and the outside of a tubing string in a cased-hole wellbore.

There are a variety of wellbore operations that can be performed on a well. A wellbore is formed using a tool called a drill bit. A tubing string, called a drill string for drilling operations, can be used to aid the drill bit in drilling through a subterranean formation to form the wellbore. The drill string can include a drilling pipe. During drilling operations, a drilling fluid, sometimes referred to as a drilling mud, is circulated downwardly through the drilling pipe, and back up the annulus between the wall of the wellbore and the outside of the drilling pipe. The drilling fluid performs various functions, such as cooling the drill bit, maintaining the desired pressure in the well, and carrying drill cuttings upwardly through the annulus between the wellbore and the drilling pipe.

Moreover, a variety of testing and completion operations can be performed on the well. Common testing operations include, but are not limited to, logging while drilling, reservoir fluid sampling, and drill stem testing. Completion operations can include, but are not limited to, gravel-packing and cementing operations. During testing and completion operations, a tool is run into the wellbore on a tubing string or coiled tubing.

Wellbore operations are not always a continuous process. For example, it may be necessary or desirable to remove a tubing string before the wellbore operation is complete. This may occur for example in adverse weather or other situations in which the wellbore operation has to be suspended for a period of time. In these situations, a valve can be used to help seal off the wellbore such that fluids are prevented from flowing from the wellbore or the subterranean formation into the wellhead. The valve can generally be positioned below one or more blow-out preventers and can function to seal off the inner diameter of a casing when the valve is in a closed position. The closed valve prevents fluids from flowing into the wellhead.

It is desirable for the valve to open as a tool is being introduced into the wellbore on a tubing string. It is then desirable for the valve to close when the tool is being removed from the wellbore. Obviously the valve should be fully opened prior to the tool reaching the valve's location so the valve and tool are not damaged by the contact. The valve should also remain open when a tubing string is located at the valve's position. In this manner, the valve would not try to close on an object, such as the tubing string. The valve should also close as soon as possible after the tool is located above the valve so fluids are prevented from flowing into the wellhead. As used herein, the relative term “above” means at a location closer to the wellhead, and the relative term “below” means at a location farther away from the wellhead.

The valve can be opened or closed by a variety of mechanisms. For example, the tool can push the valve and swing it into an open position as the tool comes in contact with the valve and then prop open the flapper valve on the way into the wellbore. When the tool is then pulled out of the wellbore, the tool pulls a sleeve out of the way allowing the flapper valve to close. However, dragging of the tool may damage the flapper valve and compromise the integrity of the valve.

By way of another example, the valve can be hydraulically activated with control lines from the surface. This method can be problematic because running control lines through a wellhead can lead to a more complicated system and can lead to damage of the control lines due to casing pinching.

By way of yet another example, pressure pulses, whereby the valve is actuated by pulsing pressure changes in a column of wellbore fluid, can be used to open and close the valve. However, pressure variations in the wellbore may not be able to signal as clearly in all situations when the valve should open or close while drilling or circulating a wellbore fluid within the wellbore.

Therefore, there is a need for improved ways to actuate the opening and closing of a valve for preventing fluid flow into a wellhead of a wellbore, while overcoming the challenges currently faced in the industry.

It has been discovered that a magnetic sensor assembly can be used to actuate the opening and closing of a valve. The sensor assembly can be used to detect the presence or absence of a downhole tool and/or tubing string and the valve can be actuated based on the location of the tool. One of the advantages to the sensor assembly is that it is autonomous and no external intervention from an operator at the surface needs to occur.

According to an embodiment, a system for actuating a valve, the system comprises: a wellbore; the valve located within a casing of the wellbore; a tool positioned at or near the bottom of a tubing string within the casing; and a sensor assembly comprising a magnet and a sensor for the magnet, wherein the sensor assembly detects the presence or absence of the tool at the location of the magnet, and wherein the sensor assembly actuates the valve to open or close based on the location of the tool.

According to another embodiment, a sensor assembly for actuating a valve comprises: the magnet; and the sensor for the magnet, wherein a tool that is positioned adjacent to the magnet alters the magnetic field of the magnet, wherein the sensor detects the alteration of the magnetic field, and when the sensor detects the alteration, then the sensor actuates a valve to open or close.

According to yet another embodiment, a method of actuating a valve in a wellbore comprises: positioning the sensor assembly within the wellbore; and running a tool into the wellbore, wherein the sensor assembly detects the presence of the tool when the tool is located adjacent to the magnet, wherein when the sensor assembly detects the presence of the tool one or more times, then the sensor assembly actuates the valve to open, and wherein the valve is located within a casing.

Any discussion of the embodiments regarding the well system or any component related to the well system is intended to apply to all of the apparatus, system, and method embodiments.

Turning to the Figures, FIG. 1 depicts a well system 10. The well system 10 can include at least one wellbore 11. The wellbore 11 can penetrate a subterranean formation 20. The subterranean formation 20 can be a portion of a reservoir or adjacent to a reservoir. The wellbore 11 can include a casing 12. The wellbore 11 can have a generally vertical uncased section extending downwardly from the casing 12, as well as a generally horizontal uncased section extending through the subterranean formation 20. The wellbore 11 can alternatively include only a generally vertical wellbore section, or can alternatively include only a generally horizontal wellbore section. The wellbore 11 can include a heel and a toe (not shown).

A tubing string 101 can be introduced into the wellbore 11, for example inside of the casing 12. The tubing string 101 can include a flow passage for the flow of fluids. It is to be understood that as used herein, a “tubing string” includes any sections of pipe that are jointed together, and can include, for example, a drill string. The well system 10 also includes the tool 102. The tool 102 can be run into the wellbore 11 via the tubing string 101. The tool 102 can be positioned at or near the bottom of the tubing string 101. The tubing string 101 and the tool 102 can both be run into the wellbore and located within the casing 12 of the wellbore 11. The tool 102 can be a drilling tool, completion tool, or testing tool. For example, as a drilling tool, the tool can be, without limitation, a drill bit or mill bit for milling through the casing to form a window of a lateral wellbore. For a completion tool, the tool can be, without limitation, a gravel packing tool or a sand screen assembly. For a testing tool, the tool can be, without limitation, measurement while drilling “MWD” tools, logging while drilling “LWD” tools, packers, flow control valves, tester valves, etc. Although reference is made to a tubing string 101, it is to be understood that a coiled tubing can also be used to run the tool 102 into the wellbore 11.

The well system 10 also includes the valve 300. The valve 300 can be a flapper valve, a ball valve, or a sliding sleeve. The valve 300 can be located inside of the casing 12. When the valve 300 is in a closed position (as depicted in FIG. 1), fluids are prevented from flowing in any direction past the valve. By contrast, when the valve 300 is in an open position (as depicted in FIG. 3), then fluid flow past the valve can occur. The valve 300 can be located above one or more blow-out preventers (not shown) and a desired distance from a wellhead of the wellbore. The valve 300 can function as a safety device to temporarily prevent fluid flow into the wellhead should Oil and Gas operations be temporarily halted. The valve 300 can be particularly useful in underbalanced operations in which the hydrostatic pressure of a column of wellbore fluid is less than the pressure of the subterranean formation 20. The valve 300 can withstand a desired pressure differential across the valve. For example, the pressure differential can come from an area above the valve or an area below the valve. The desired pressure differential can be the amount of pressure exerted from wellbore fluids located above and/or below the valve. When the valve 300 is in the closed position, a locking mechanism can be used on one or more locations around the valve to lock the valve in the closed position to be able to withstand the desired pressure differential. In this manner, fluid flow is substantially inhibited or prevented from flowing past the valve. When the valve 300 is actuated to open or close, a mechanism can cause the valve to move into the open or closed position, via, for example release or actuation of the locking mechanism(s). An operator at the surface of the wellbore can determine whether the valve has opened or closed due to pressure changes that can be observed at the surface.

The well system 10 also includes the sensor assembly 200. The sensor assembly 200 can be positioned on the casing 12 (shown in the Figures), drill pipe, or as part of a bottomhole assembly (not shown) of the tool 102. The sensor assembly 200 includes a magnet 201. The magnet 201 can be a permanent magnet, electromagnets, and any other type of magnet with a magnetic polarity. The magnet 201 can produce a magnetic field.

The sensor assembly 200 also includes a sensor for the magnet 202. The sensor 202 can detect the magnetic field from the magnet 201. The sensor 202 can be positioned at a location that is close enough to the magnet 201 for the sensor 202 to be able to detect the magnetic field from the magnet 201. The sensor 202 can be any sensor that detects the magnetic field from the magnet, including, but not limited to, Hall effect sensor, magneto-diode, magneto-transistor, anisotropic magnetoresistance (AMR) magnetometer, giant magnetoresistance (GMR) magnetometer, magnetic tunnel junction magnetometer, magneto-optical sensor, Lorentz force-based micro-electro-mechanical systems (MEMS) sensor, electron tunneling-based MEMS sensor, MEMS compass, optically pumped magnetic field sensor, fluxgate magnetometer, search coil magnetic field sensor, and superconducting quantum interference devices (SQUID) magnetometer.

The magnet 201 and optionally the sensor 202 can be partially surrounded by a shield (not shown) to help prevent or minimize any interferences with the magnetic field from the casing 12 or other metallic wellbore equipment. In this manner, the sensor can detect changes in the magnetic field from the magnet due to the desired wellbore equipment, such as the tool. The location of the shield, the material the shield is made from, and the thickness of the shield can all be selected to provide the desired shielding to prevent undesirable alterations to the magnetic field of the magnet.

The sensor 202 and any other components, such as a transmitter or actuator for the valve, can be powered by one or more batteries. Batteries are useful because they prevent power lines from having to be run into the wellbore to supply power, in which power lines can be problematic.

The methods include running the tool 102 into the wellbore 11. Turning to FIG. 1A, when the tool 102 is located above the sensor assembly 200, for example as the tool is being run into the wellbore, then the valve 300 is closed and the magnetic field from the magnet 201 is not altered. However, as can be seen in FIG. 2A, when the tool 102 is positioned adjacent to the magnet 201, then the tool 102 alters the magnetic field of the magnet 201. The alteration of the magnetic field can be caused by: at least a portion of the tool 102 having a larger outer diameter than the outer diameter of the tubing string 101; at least a portion of the tool having a different type of metal or metal alloy than the rest of the tool and the tubing string; at least a portion of the tool having a much higher concentration of a certain type of metal or metal alloy than the rest of the tool and the tubing string, and combinations thereof. Of course, the entire tool can have a larger outer diameter, different metal or metal alloy, or concentration of metal or metal alloy than the tubing string. A piece of metal or metal alloy that has a larger outer diameter than the rest of the tool and/or the tubing string can also be added to the tool in order to provide the larger outer diameter. According to certain embodiments, the bottom portion of the tool has the larger outer diameter, different metal or metal alloy, or higher concentration of the metal or metal alloy. In this manner, it is the bottom part of the tool that alters the magnetic field. The sensor assembly 200 can detect the presence or absence of the tool at the location of the magnet based on the alteration of the magnetic field.

The sensor 202 detects the alteration of the magnetic field. The sensor 202 can be programmed to detect the alteration in the magnetic field based on the type of causation of the magnetic field alteration. The sensor assembly 200 can also include a data acquisition system (not shown). The data acquisition system can be used to collect information from the sensor about alterations to the magnetic field. The sensor assembly 200 can also include a transmitter (not shown) to transmit the information to the valve 300. The transmitter can transmit the information to an actuator, for example, to actuate the opening or closing of the valve. The sensor assembly 200 is autonomous in that in order to actuate opening or closing of the valve 300, there is no human interaction that is required. Rather, the sensor assembly 200 functions to autonomously open or close the valve 300 based on the location of the tool 102.

As can be seen in FIGS. 2 and 3, when the tool 102 is located adjacent to the magnet 201, the magnetic field is altered and the sensor 202 detects the presence of the tool 102. The actuator for the valve 300 can then be signaled to open the valve and allow the undeterred passage of the tool 102 and the tubing string 101. According to certain embodiments, the sensor also detects the presence of the tubing string or other wellbore components after the valve has been actuated to open. In this manner, the valve does not try to close when an object, such as the tubing string is located within the wellbore. This can prevent damage to the valve and the object.

Turning to FIGS. 4A-4E, the sensor 202 can be programmed to actuate the valve 300 based on a specific sequence of detecting the presence and absence of the tool 102 more than one time. For example, FIGS. 1-3 depict the actuation of the valve 300 due to the sensor assembly 200 detecting the presence of the tool 102 one time. By contrast, FIGS. 4A-4E depict the actuation of the valve due to the sensor assembly detecting the presence of the tool more than one time. By way of example, the sequence depicted in FIGS. 4A-4D is as follows: presence, absence, presence, absence. This sequence can be performed by lowering, raising, lowering, and then raising the tubing string 101 and the tool 102. When the pre-programmed sensor assembly 200 detects this specific sequence, then the transmitter transmits the information to the actuator to cause the valve 300 to open, as shown in FIG. 4E. Of course the actual sequence used could be any of a variety of sequences and combinations.

There can also be more than one sensor assembly 200 positioned within the wellbore. For example, there could be two or more sensor assemblies 200 positioned circumferentially around the casing 12. Additionally, there could also be two or more sensor assemblies 200 positioned along a longitudinal axis of the casing 12. There can also be sensor assemblies 200 positioned in both a longitudinal direction and circumferentially around the casing 12. These embodiments can be useful when it is desirable to provide some assurance that at least one sensor assembly 200 will be able to detect the presence of the tool 102. By way of example, it may not be possible to know exactly how far within the wellbore 11 the tool 102 is lowered, and if the tool is not lowered far enough, then the sensor assembly 200 will not detect the presence of the tool. Therefore, longitudinally-spaced sensor assemblies 200 can help ensure that even if the lowering of the tool 102 is not exact, then at least one of the sensor assemblies 200 will detect the presence so long as the tool is lowered some distance into the wellbore.

After the valve 300 is actuated to open, the tubing string 101 and the tool 102 can be run further into the wellbore 11 to perform the operation, such as drilling, milling, completion operations, or testing operations. In the event that the tool 102 needs to be removed from the wellbore 11, then the tubing string 101 and tool can be retrieved from the wellbore. Upon removal of the tool 102, the sensor assembly 200 can detect the presence of the tool again. The sensor assembly 200 can be programmed to actuate the valve 300 to close when the presence of the tool 102 is detected again. The sensor assembly 200 can also be programmed to close the valve 300 when the same sequence (as discussed with reference to FIGS. 4A-4D) or even a different sequence is detected by the sensor assembly 200. With the valve 300 now in a closed position, wellbore fluids are prevented from flowing to the wellhead and the integrity of the wellbore is maintained.

The valve 300 can be actuated opened or closed any of a number of times based on the location of the tool 102 in relation to the magnet 201. In this manner, the tool 102 can be tripped in and out of the wellbore 11 as often as needed based on the conditions at the well site. Of course the tool 102 does not have to be the same for each trip. For example, a drill bit can be introduced and then removed from the wellbore, wherein the valve is opened then closed, and then a completion tool can then be introduced and possibly removed from the wellbore.

It should be noted that the well system 10 is illustrated in the drawings and is described herein as merely one example of a wide variety of well systems in which the principles of this disclosure can be utilized. It should be clearly understood that the principles of this disclosure are not limited to any of the details of the well system 10, or components thereof, depicted in the drawings or described herein. Furthermore, the well system 10 can include other components not depicted in the drawing.

Therefore, the present system is well adapted to attain the ends and advantages mentioned as well as those that are inherent therein. The particular embodiments disclosed above are illustrative only, as the principles of the present disclosure can be modified and practiced in different but equivalent manners apparent to those skilled in the art having the benefit of the teachings herein. Furthermore, no limitations are intended to the details of construction or design herein shown, other than as described in the claims below. It is, therefore, evident that the particular illustrative embodiments disclosed above can be altered or modified and all such variations are considered within the scope and spirit of the principles of the present disclosure.

As used herein, the words “comprise,” “have,” “include,” and all grammatical variations thereof are each intended to have an open, non-limiting meaning that does not exclude additional elements or steps. While compositions and methods are described in terms of “comprising,” “containing,” or “including” various components or steps, the compositions and methods also can “consist essentially of” or “consist of” the various components and steps. Whenever a numerical range with a lower limit and an upper limit is disclosed, any number and any included range falling within the range is specifically disclosed. In particular, every range of values (of the form, “from about a to about b,” or, equivalently, “from approximately a to b”) disclosed herein is to be understood to set forth every number and range encompassed within the broader range of values. Also, the terms in the claims have their plain, ordinary meaning unless otherwise explicitly and clearly defined by the patentee. Moreover, the indefinite articles “a” or “an,” as used in the claims, are defined herein to mean one or more than one of the element that it introduces. If there is any conflict in the usages of a word or term in this specification and one or more patent(s) or other documents that can be incorporated herein by reference, the definitions that are consistent with this specification should be adopted. 

What is claimed is:
 1. A system for actuating a valve, the system comprising: a wellbore; the valve located within a casing of the wellbore; a tool positioned at or near the bottom of a tubing string within the casing; and a sensor assembly comprising a magnet and a sensor for the magnet, wherein the sensor assembly detects the presence or absence of the tool at the location of the magnet, and wherein the sensor assembly actuates the valve to open or close based on the location of the tool.
 2. The system according to claim 1, wherein the tool is a drilling tool, completion tool, or testing tool.
 3. The system according to claim 1, wherein the valve is a flapper valve, a ball valve, or a sliding sleeve.
 4. The system according to claim 1, wherein when the valve is in a closed position, fluids are prevented from flowing in any direction past the valve through the casing, and when the valve is in an open position, fluid flow past the valve can occur.
 5. The system according to claim 1, wherein the sensor assembly detects the presence of the tool at the location of the magnet due to an alteration of the magnetic field caused by the tool.
 6. The system according to claim 5, wherein the alteration of the magnetic field is caused by: at least a portion of the tool having a larger outer diameter than the outer diameter of the tubing string or the tubing string and the rest of the tool; at least a portion of the tool having a different type of metal or metal alloy than the tubing string or the tubing string and the rest of the tool; at least a portion of the tool having a higher concentration of a certain type of metal or metal alloy than the tubing string or the tubing string and the rest of the tool; and combinations thereof.
 7. The system according to claim 6, wherein when the tool is positioned adjacent to the magnet, then the tool alters the magnetic field of the magnet.
 8. The system according to claim 6, wherein the sensor is selected from a Hall effect sensor, magneto-diode, magneto-transistor, anisotropic magnetoresistance (AMR) magnetometer, giant magnetoresistance (GMR) magnetometer, magnetic tunnel junction magnetometer, magneto-optical sensor, Lorentz force-based micro-electro-mechanical systems (MEMS) sensor, electron tunneling-based MEMS sensor, MEMS compass, optically pumped magnetic field sensor, fluxgate magnetometer, search coil magnetic field sensor, or superconducting quantum interference devices (SQUID) magnetometer.
 9. The system according to claim 6, wherein the magnet or the magnet and the sensor are partially surrounded by a shield, wherein the shield at least partially prevents or minimizes interferences with the magnetic field from the casing or other metallic wellbore equipment other than the tool.
 10. The system according to claim 1, wherein the sensor assembly further comprises a transmitter to transmit information from the sensor to the valve about the location of the tool to cause the valve to open or close.
 11. The system according to claim 1, wherein the sensor is programmed to actuate the valve based on a specific sequence of detecting the presence and absence of the tool more than one time.
 12. A method of actuating a valve in a wellbore comprising: positioning a sensor assembly within the wellbore, the sensor assembly comprising a magnet and a sensor for the magnet; and running a tool into the wellbore, wherein the sensor assembly detects the presence of the tool when the tool is located adjacent to the magnet, wherein when the sensor assembly detects the presence of the tool one or more times, then the sensor assembly actuates the valve to open, and wherein the valve is located within a casing of the wellbore.
 13. The method according to claim 13, wherein when the valve is in a closed position, fluids are prevented from flowing in any direction past the valve through the casing, and when the valve is in an open position, fluid flow past the valve can occur.
 14. The method according to claim 13, wherein the sensor assembly detects the presence of the tool at the location of the magnet due to an alteration of the magnetic field caused by the tool.
 15. The method according to claim 14, wherein the alteration of the magnetic field is caused by: at least a portion of the tool having a larger outer diameter than the outer diameter of the tubing string or the tubing string and the rest of the tool; at least a portion of the tool having a different type of metal or metal alloy than the tubing string or the tubing string and the rest of the tool; at least a portion of the tool having a higher concentration of a certain type of metal or metal alloy than the tubing string or the tubing string and the rest of the tool; and combinations thereof.
 16. The method according to claim 15, wherein when the tool is positioned adjacent to the magnet, then the tool alters the magnetic field of the magnet.
 17. The method according to claim 15, wherein the sensor is selected from a Hall effect sensor, magneto-diode, magneto-transistor, anisotropic magnetoresistance (AMR) magnetometer, giant magnetoresistance (GMR) magnetometer, magnetic tunnel junction magnetometer, magneto-optical sensor, Lorentz force-based micro-electro-mechanical systems (MEMS) sensor, electron tunneling-based MEMS sensor, MEMS compass, optically pumped magnetic field sensor, fluxgate magnetometer, search coil magnetic field sensor, or superconducting quantum interference devices (SQUID) magnetometer.
 18. The method according to claim 13, wherein the sensor assembly further comprises a transmitter to transmit information from the sensor to the valve about the location of the tool to cause the valve to open or close.
 19. The method according to claim 13, wherein the sensor is programmed to actuate the valve based on a specific sequence of detecting the presence and absence of the tool more than one time.
 20. The method according to claim 13, wherein after the valve is actuated to open, the tubing string and the tool can be run further into the wellbore to perform the operation.
 21. The method according to claim 20, wherein the tubing string and tool can be retrieved from the wellbore before or after the operation is performed.
 22. The method according to claim 21, wherein when the tubing string and tool are retrieved from the wellbore, the sensor assembly detects the presence of the tool a second time.
 23. The method according to claim 23, wherein the sensor assembly is programmed to actuate the valve to close when the presence of the tool is detected the second time.
 24. A sensor assembly for actuating a valve comprising: a magnet; and a sensor for the magnet, wherein a tool that is positioned adjacent to the magnet alters the magnetic field of the magnet, wherein the sensor detects the alteration of the magnetic field, and when the sensor detects the alteration, then the sensor actuates a valve to open or close. 